<?php

namespace App\Traits;

use App\Models\ResourceModel;

trait ImageTrait
{
    /**
     * 获取资源数据
     * @param string $ids
     * @return array
     */
    protected static function getImage(string $ids)
    {
        if (empty($ids)) {
            return [];
        }
        return ResourceModel::getValueByIds(explode(',', $ids));
    }

    protected static function getImageList(string $ids)
    {
        if (empty($ids)) {
            return [];
        }
        return ResourceModel::getListByIds(explode(',', $ids));
    }
}
